home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / crc_lib2 / crc.txt < prev   
Text File  |  1995-01-09  |  5KB  |  134 lines

  1.  
  2.   CRC.LIB - written by Jan Kriesten 
  3. ================================================================================
  4.   (c) 1994,1995 by Jan Kriesten, all rights reserved.
  5.   
  6.       Author:   Jan Kriesten
  7.                 Friedhofstr. 25 b
  8.                 35043 Marburg
  9.                 Germany
  10.       EMail:    Maus GI
  11.                 90:400/1002@nest.ftn
  12.                 51:601/103@atarinet.ftn
  13.                 2:244/4344@fidonet.org
  14.   
  15. ================================================================================
  16.   
  17. Introduction:
  18. =============
  19.   
  20.   CRC calculation is an important thing if one wants to check occuring
  21.   errors/changes to certain data packets/files, e.g. during transfering
  22.   data via modem.
  23.   
  24.   This is the reason why CRC calculation is a question of time, too. To
  25.   get best transfer rates during data transmission via modem one needs
  26.   also fast CRC calculation.
  27.   
  28.   The fastest way to calculate the CRC sum is byte by byte with a preset
  29.   crc table. This method was integrated in the library with the crc tables
  30.   included.
  31.   
  32.   Also, all CRC calculations are highly optimized and written in 
  33.   assembler.
  34.   
  35.   As far as I know there are currently three CRC standards which are 
  36.   widely used in verifying data:
  37.   
  38.   Type                 | Polynom
  39.   ---------------------+---------------------------------------------------
  40.   CRC-16               | x^16 + x^15 + x^2 + 1
  41.   CRC-16 (CCITT V.41)  | x^16 + x^12 + x^5 + 1
  42.   CRC-32 (ANSI X3.66)  | x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11
  43.                        | + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
  44.   
  45.   All three are integrated in this library.
  46.   
  47. Copyright:
  48. ==========
  49.   
  50.   Copyright (c) 1994,1995 by Jan Kriesten
  51.   
  52.   Please notice that the library is not 'public domain' or 'freeware',
  53.   but it's allowed to spread it out (without charging fees) via public
  54.   BBS or public networks like FidoNet. In any case the original archive
  55.   has to be spread out and must not be modified.
  56.   
  57.   It's not allowed to make this library available via other channels like
  58.   pd disk series, cd rom's or channel videodat.
  59.   
  60.   Using this library in commercial/shareware programs is only allowed with
  61.   permission of the author.
  62.   
  63. Disclaimer:
  64. ===========
  65.   
  66.   Every care is taken to ensure that these routines are bug free and will
  67.   not cause any trouble on your system.
  68.   
  69.   However, I take no responsibility for any harm that may occur to your
  70.   system by using this library.
  71.   
  72. Description:
  73. ============
  74.   
  75.   The library is designed to be used together with PureC. To use the 
  76.   routines you just have to move crc.h and crc.lib to the corresponding
  77.   include-/library folder of PureC and add crc.lib to your project file.
  78.   
  79.   The following routines are available. Please refer to the file
  80.   crc.h for further descriptions:
  81.   
  82.   /*
  83.    * CRC-CCITT
  84.    */
  85.   unsigned int Crc16cStr( unsigned char *str );
  86.   unsigned int Crc16cBlk( unsigned char *blk, unsigned long length );
  87.   unsigned int Crc16cUpd( unsigned int crc, unsigned char c );
  88.   unsigned int Crc16cBlkUpd( unsigned int oldcrc, unsigned char *blk, unsigned long length );
  89.   unsigned int Crc16cShort( unsigned int oldcrc, unsigned char *blk, int length );
  90.  
  91.   /*
  92.    *  The return values of the following functions have to be
  93.    *  negated at the _end_ of calculation!
  94.    */
  95.  
  96.   /*
  97.    * CRC-16
  98.    */
  99.   unsigned int Crc16Str( unsigned char *str );
  100.   unsigned int Crc16Blk( unsigned char *blk, unsigned long length );
  101.   unsigned int Crc16Upd( unsigned int crc, unsigned char c );
  102.   unsigned int Crc16BlkUpd( unsigned int oldcrc, unsigned char *blk, unsigned long length );
  103.   unsigned int Crc16Short( unsigned int oldcrc, unsigned char *blk, int length );
  104.  
  105.   /*
  106.    * CRC-32
  107.    */
  108.   unsigned long Crc32Str( unsigned char *str );
  109.   unsigned long Crc32Blk( unsigned char *blk, unsigned long length );
  110.   unsigned long Crc32Upd( unsigned long crc, unsigned char c );
  111.   unsigned long Crc32BlkUpd( unsigned long oldcrc, unsigned char *blk, unsigned long length );
  112.   unsigned long Crc32Short( unsigned long oldcrc, unsigned char *blk, int length );
  113.  
  114. Trailer:
  115. ========
  116.   
  117.   This library will be supported - or not. This is depending on how
  118.   many people are using - and supporting - this library. If you like
  119.   this library and you're using it in your own programs you should think
  120.   of making a donation for it. Any donation is welcome and will increase
  121.   my motivation of supporting it further.
  122.   
  123.   My bank account:
  124.   
  125.   Jan Kriesten, Citibank
  126.                 Kto.-Nr. 0910680784
  127.                 BLZ      300 209 00
  128.   
  129.   Any suggestions or bug reports please send to any of the above EMail
  130.   adresses.
  131.  
  132. ===============================[ End of CRC.TXT ]===============================
  133.  
  134.